<?php
    include_once("../inc/connection.php");
    include_once("../inc/constants.inc.php");
    $test_type = mysql_real_escape_string($_GET['typeId']);
	$student_id = mysql_real_escape_string($_GET['student_id']);
    $return_data='';
	$submitted = false;
	$testOver = false;
	
	$res = mysql_query("SELECT submitted FROM `login_details` where `userID` = '$student_id'");	
	while($row = mysql_fetch_array($res))
	{
		if($row['submitted']=="yes")
		$submitted = true;
	}
	$res = mysql_query("SELECT * FROM `answer_sheet` where `studentID` = '$student_id' and  `isReset`='no' ");	
	while($row = mysql_fetch_array($res))
	{
		$testOver = true;
	}
	if($submitted || $testOver)
	{$return_data = "1";}
	else
	{$return_data = "2";}
	
	echo $return_data ;
?>